<template>
  <div id="components-a-popconfirm-demo-placement">
    <div :style="{ marginLeft: `${buttonWidth}px`, whiteSpace: 'nowrap' }">
      <CloudPopconfirm placement="topLeft" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>TL</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="top" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>Top</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="topRight" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>TR</CloudButton>
      </CloudPopconfirm>
    </div>
    <div :style="{ width: `${buttonWidth}px`, float: 'left' }">
      <CloudPopconfirm placement="leftTop" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>LT</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="left" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>Left</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="leftBottom" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>LB</CloudButton>
      </CloudPopconfirm>
    </div>
    <div :style="{ width: `${buttonWidth}px`, marginLeft: `${buttonWidth * 4 + 24}px` }">
      <CloudPopconfirm placement="rightTop" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>RT</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="right" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>Right</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="rightBottom" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>RB</CloudButton>
      </CloudPopconfirm>
    </div>
    <div :style="{ marginLeft: `${buttonWidth}px`, clear: 'both', whiteSpace: 'nowrap' }">
      <CloudPopconfirm placement="bottomLeft" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>BL</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="bottom" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>Bottom</CloudButton>
      </CloudPopconfirm>
      <CloudPopconfirm placement="bottomRight" ok-text="Yes" cancel-text="No" @confirm="confirm">
        <template slot="title">
          <p>{{ text }}</p>
        </template>
        <CloudButton>BR</CloudButton>
      </CloudPopconfirm>
    </div>
  </div>
</template>
<script>
// import { message } from 'ant-design-vue';

export default {
  title: '2.位置',
  data() {
    return {
      buttonWidth: 70,
      text: 'Are you sure to delete this task?',
    };
  },
  methods: {
    confirm() {
      this.$cloudMessage.info('Clicked on Yes.');
    },
  },
};
</script>
<style scoped>
#components-a-popconfirm-demo-placement .ant-btn {
  width: 70px;
  text-align: center;
  padding: 0;
  margin-right: 8px;
  margin-bottom: 8px;
}
</style>